package com.lucas.servlet.chapter5.mapper;

import com.lucas.servlet.chapter5.entity.Blog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BlogMapper {
    @Select("select *from m_blog order by create_at desc")
    List<Blog> selectAll();

    @Select("select *from m_blog order by create_at desc limit #{limit} offset #{offset}")
    List<Blog>selectBlogsByPage(Integer offset, Integer limit);

    //查询数据库中有多少条数据
    @Select("select count(*) from m_blog")
    Integer selectCount();
}

